/**
 * Copyright &copy; 2012-2017 <a href="https://vivo.com">vivo</a> All rights reserved.
 */
package com.vivo.retail.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.vivo.retail.entity.VivoRetailOrder;
import com.vivo.retail.dao.VivoRetailOrderDao;

/**
 * 零售单Service
 * @author jyangye
 * @version 2017-11-17
 */
@Service
@Transactional(readOnly = true)
public class VivoRetailOrderService extends CrudService<VivoRetailOrderDao, VivoRetailOrder> {
    @Autowired
    private VivoRetailOrderDao vivoRetailOrderDao;

	public VivoRetailOrder get(String id) {
		return super.get(id);
	}

	public VivoRetailOrder get(VivoRetailOrder vivoRetailOrder) {
		return super.get(vivoRetailOrder);
	}

	public VivoRetailOrder getLast(VivoRetailOrder vivoRetailOrder) {
	    return vivoRetailOrderDao.getLastChangeData(vivoRetailOrder);
    }

	
	public List<VivoRetailOrder> findList(VivoRetailOrder vivoRetailOrder) {
		return super.findList(vivoRetailOrder);
	}


	public Page<VivoRetailOrder> findPage(Page<VivoRetailOrder> page, VivoRetailOrder vivoRetailOrder) {
		return super.findPage(page, vivoRetailOrder);
	}
	
	@Transactional(readOnly = false)
	public void insertByBatch(List<VivoRetailOrder> oderList, String area) {
	    if (area.equals("ah")) {
	        vivoRetailOrderDao.insertByBatchAh(oderList);
        } else {
	        vivoRetailOrderDao.insertByBatchJs(oderList);
        }
	}

	@Transactional(readOnly = false)
	public void save(VivoRetailOrder vivoRetailOrder) {
		super.save(vivoRetailOrder);
	}

	@Transactional(readOnly = false)
	public void delete(VivoRetailOrder vivoRetailOrder) {
		super.delete(vivoRetailOrder);
	}
	
}